package com.zaydanwu.wzo_test.cglib;

import org.springframework.cglib.proxy.MethodInterceptor;
import org.springframework.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @author wzo
 * @since 2.0.0 2019-01-22
 */
public class Interceptor implements MethodInterceptor {

//    方法拦截对象

    @Override
    public Object intercept(Object obj, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {

        System.out.println("开始");
        Object o = methodProxy.invokeSuper(obj, objects);
        System.out.println("结束");
        return o;
    }
}
